@charset "utf-8";

/* Round Phone Theme - 방명록 스킨 */

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* [1] 전체 래퍼 */
#chat_board_wrap {
    width: var(--board-width, 400px);
    height: 75vh;
    max-height: var(--board-max-height, 720px);
    min-height: 400px;
    margin: 40px auto;
    position: relative;
    animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* [2] 실제 핸드폰 프레임 (본체) */
.chat-frame-body {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 10; 
    
    background-color: var(--bg-color, #f5f5f5);
    background-image: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)), var(--bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    border: 8px solid var(--point-color, #97c3d1);    
    outline: 1px solid rgba(0,0,0,0.1); 
    border-radius: 45px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    
    display: flex;
    flex-direction: column;
    overflow: hidden; 
}

/* [3] 빼꼼 이미지 */

/* 쫑쫑! (JongJong) 애니메이션 */
@keyframes jongJong {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* 개별 아이템 공통 */
.peek-item {
    position: absolute;
    width: 180px; 
    height: auto;
    z-index: 5; 
    cursor: pointer;
    pointer-events: auto;
}

/* 1. 왼쪽 상단 (Left Wall) */
.peek-item.pos-tl {
    top: 60px;      
    left: -125px;   
    transform: rotate(-35deg); 
}

/* 2. 오른쪽 하단 (Right Wall) */
.peek-item.pos-br {
    bottom: 60px; 
    right: -125px;  
    transform: rotate(35deg);  
}

/* 이미지 컨테이너 */
.peek-img-box {
    width: 100%;
    transition: transform 0.2s;
}

.peek-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
}

.peek-item:hover .peek-img-box {
    animation: jongJong 0.4s ease-in-out 1;
}

/* 말풍선 공통 스타일 */
.peek-msg {
    position: absolute;
    white-space: nowrap;
    background: #fff;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 8px 12px;
    color: #333;
    font-size: 13px;
    font-weight: bold;
    
    
    opacity: 0; 
    visibility: hidden;
    
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    pointer-events: none;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.peek-item:hover .peek-msg {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* 왼쪽 빼꼼 말풍선 */
.peek-item.pos-tl .peek-msg {
    bottom: 80%;   
    right: 40%;    /* 캐릭터 중심 기준 배치 */
    transform: scale(0.9) rotate(35deg); 
    transform-origin: bottom right;
}
/* 꼬리 */
.peek-item.pos-tl .peek-msg::after {
    content: ""; position: absolute;
    bottom: -8px; right: 20px;
    border-width: 8px 0 0 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}
.peek-item.pos-tl .peek-msg::before {
    content: ""; position: absolute;
    bottom: -4px; right: 22px;
    border-width: 6px 0 0 4px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
    z-index: 1;
}

/* 오른쪽 빼꼼 말풍선 */
.peek-item.pos-br .peek-msg {
    bottom: 80%;   
    left: 40%;     
    transform: scale(0.9) rotate(-35deg); 
    transform-origin: bottom left;
}
/* 꼬리 */
.peek-item.pos-br .peek-msg::after {
    content: ""; position: absolute;
    bottom: -8px; left: 20px;
    border-width: 8px 6px 0 0;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}
.peek-item.pos-br .peek-msg::before {
    content: ""; position: absolute;
    bottom: -4px; left: 22px;
    border-width: 6px 4px 0 0;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
    z-index: 1;
}

.peek-item.empty { display: none; }

/* 공지사항 바 */
.notice-bar-area {
    position: relative; 
    width: 100%;
    flex-shrink: 0;
    
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 40;
    transition: all 0.3s ease-in-out;
    min-height: 45px;
    box-sizing: border-box;
    height: auto;
    overflow: hidden; 
}

/* 공지 펼침 상태 */
.notice-bar-area.expanded {
    padding-bottom: 35px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.notice-content { 
    display: flex; 
    align-items: flex-start; 
    gap: 10px; 
    width: 100%; 
    cursor: pointer; 
    padding-right: 50px; 
    box-sizing: border-box;
}

.icon-mega {
    font-style: normal; font-size: 14px; filter: grayscale(100%); opacity: 0.6;
    margin-top: 3px; flex-shrink: 0;
}

/* 텍스트 영역 */
.notice-text {
    font-weight: bold; color: #555; line-height: 1.5; font-size: 12px;
    white-space: normal; word-break: break-all;
    
    
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 3.2em; 
    transition: max-height 0.3s ease-in-out;
}

/* 펼쳐졌을 때 텍스트 */
.notice-bar-area.expanded .notice-text {
    -webkit-line-clamp: unset;
    max-height: 1000px; 
    overflow: visible;
}

.notice-bar-area.expanded .notice-toggle-btn {
    transform: rotate(180deg);
}

.notice-toggle-btn {
    background: none; border: none; padding: 0; color: #bbb;
    font-size: 10px; margin-top: 4px; cursor: pointer;
    transition: 0.3s; flex-shrink: 0;
}

/* 공지 관리 버튼 */
.notice-admin-btns {
    position: absolute;
    top: 12px;
    right: 30px; /* 펼침 화살표와 겹치지 않게 왼쪽으로 이동 */
    display: flex; gap: 4px;
    z-index: 100;
}
.notice-btn-mini {
    width: 22px; height: 22px;
    border: 1px solid #ddd; background: #fff; /* 배경색 명시 */
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: #888; cursor: pointer; font-size: 11px; text-decoration: none;
    transition: 0.2s;
}
.notice-btn-mini:hover { background: #ffeded; color: #ff5555; border-color: #ffcccc; }

.top-function-icons { position: absolute; top: 15px; right: 15px; z-index: 50; display: flex; gap: 8px; }
.top-btn { background: rgba(255,255,255,0.6); border: none; padding: 0; cursor: pointer; color: #777; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none;}
.top-btn:hover { color: #333; background: #fff; transform: rotate(15deg); }
.top-btn svg { width: 18px; height: 18px; fill: currentColor; }

.chat-write-section { background: rgba(255,255,255,0.95); padding: 15px; border-bottom: 1px solid #ececec; z-index: 30; flex-shrink: 0; backdrop-filter: blur(5px); border-radius: 38px 38px 0 0; }
.chat-header-row { 
    display: flex; 
    align-items: center; 
    gap: 8px; /* 간격 조정 */
    margin-bottom: 10px; 
    flex-wrap: nowrap; /* 줄바꿈 금지 */
    white-space: nowrap; 
}
/* 체크박스 라벨 정렬 보정 */
.chat-header-row label {
    display: flex;
    align-items: center;
    margin: 0;
}
.input-mini { width: 70px; border: 1px solid #ddd; background: #fff; padding: 6px 10px; font-size: 12px; border-radius: 8px; outline: none; transition: 0.2s; }
.input-mini:focus { border-color: var(--point-color, #97c3d1); }
.btn-icon { border: 1px solid #eee; background: #fff; color: #888; width: 30px; height: 30px; font-size: 14px; cursor: pointer; border-radius: 8px; padding: 0; display: flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: #f0f0f0; color: #555; border-color: #ccc; }
.secret-check-box { position: relative; width: 30px; height: 30px; }
.secret-check-box input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; z-index: 2; }
.secret-check-icon { width: 100%; height: 100%; border: 1px solid #eee; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #ddd; transition: 0.2s; }
.secret-check-box input:checked + .secret-check-icon { background: #fff0f0; border-color: #ffcccc; color: #ff6b6b; }
#reply_indicator_box { background: #f0f7f9; padding: 6px 10px; margin-bottom: 5px; border-radius: 8px; font-size: 12px; color: #555; display: flex; justify-content: space-between; align-items: center; border: 1px solid #e1eef3; }
.btn-cancel-reply { background: none; border: none; cursor: pointer; color: #888; font-size: 11px; }
.chat-input-row.compact-mode { display: flex; align-items: center; gap: 8px; background: #f9f9f9; border: 1px solid #eee; border-radius: 20px; padding: 5px 5px 5px 15px; }
.chat-input-row textarea { flex-grow: 1; height: 34px; border: none; resize: none; outline: none; font-size: 13px; color: #333; background: transparent; padding: 8px 0; line-height: 1.4; }
.btn-send-icon { width: 34px; height: 34px; background: var(--point-color, #97c3d1); color: #fff; border: none; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; flex-shrink: 0; transition: 0.2s; }
.btn-send-icon:hover { opacity: 0.9; transform: scale(1.05); }
.btn-send-icon svg { width: 16px; height: 16px; fill: #fff; }

/* 채팅 리스트 영역 */
.chat-list-area { 
    flex-grow: 1; 
    overflow-y: scroll; 
    
    padding: 20px 15px 20px; 
    scroll-behavior: smooth; 
    background: transparent; 
    border-radius: 0 0 38px 38px; 
    position: relative;
    z-index: 5;
}

.chat-list-area::-webkit-scrollbar { width: 5px; }
.chat-list-area::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.1); border-radius: 10px; }
.chat-list-area::-webkit-scrollbar-track { background-color: transparent; }

.chat-row { display: flex; flex-direction: column; margin-bottom: 15px; }
.bubble-container { display: flex; align-items: flex-end; max-width: 85%; gap: 6px; }
.chat-bubble-left { 
    align-self: flex-start; 
    max-width: 90%;
}
.chat-bubble-left .profile-name { font-size: 11px; color: #666; margin: 0 0 4px 5px; text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff; }
.chat-bubble-left .bubble-content { 
    position: relative; 
    background: var(--post-bg-color, #fff);  
    color: var(--post-text-color, #333);     
    padding: 10px 14px; 
    border-radius: 0 18px 18px 18px; 
    font-size: 13px; 
    line-height: 1.5; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); 
    border: 1px solid #eee; 
    word-break: break-word;   
    word-wrap: break-word;    
}
.chat-bubble-left .bubble-content::before { 
    content: ""; position: absolute; 
    top: -1px;
    left: -8px; width: 0; height: 0; 
    border-bottom: 9px solid transparent; 
    border-right: 8px solid #eee; 
}
.chat-bubble-left .bubble-content::after { 
    content: ""; position: absolute; 
    top: 0px;
    left: -6px; width: 0; height: 0; 
    border-bottom: 8px solid transparent; 
    border-right: 7px solid var(--post-bg-color, #fff); 
}
/* 답글 영역 */
.chat-bubble-right-area { 
    align-self: flex-end; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    width: 100%; /* 전체 폭 사용 */
    margin-top: 5px;
}
/* 답글 아이템 */
.item-comment {
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
    margin-bottom: 8px;
    width: 100%;
    position: relative;
}

/* 답글 말풍선 + 버튼 */
.item-comment .bubble-container { 
    display: flex;
    flex-direction: row-reverse; 
    align-items: flex-end;       
    gap: 6px; 
    max-width: 90%;              
}

/* 답글 작성자 이름 (말풍선 바깥 위에 표시) */
.reply-author {
    display: var(--reply-name-display, none);
    font-size: 10px;
    font-weight: 700;
    opacity: 0.65;
    margin-bottom: 3px;
    text-align: right;
    padding-right: 10px;
    color: #999;
}

/* 답글 말풍선 */
.item-comment-box { 
    position: relative; 
    background: var(--reply-color, #4a5568); 
    color: var(--reply-text-color, #fff);
    padding: 10px 14px; 
    border-radius: 18px 0 18px 18px; 
    font-size: 13px; 
    line-height: 1.5; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); 
    
    text-align: left; /* 텍스트는 왼쪽 정렬 */
    white-space: normal;
    word-break: break-all;
}

/* 답글 꼬리 */
.item-comment-box::before { 
    content: "";
    position: absolute; 
    top: 0;
    right: -8px;
    width: 9px;
    height: 10px;
    background: var(--reply-color, #4a5568);
    clip-path: polygon(0 0, 0 100%, 100% 0);
}

/* 답글 하단 (시간, 수정버튼) */
.item-comment .co-footer { 
    margin-top: 2px; 
    font-size: 10px; 
    color: #ccc; 
    text-align: right; 
    padding-right: 2px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.item-comment .co-footer a { color: #ccc; text-decoration: none; margin-left: 5px; }

.action-btn-group { opacity: 0.4; transition: 0.2s; display: flex; gap: 3px; }
.chat-row:hover .action-btn-group { opacity: 1; }
.btn-icon-small { background: none; border: none; padding: 0; cursor: pointer; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: #aaa; border-radius: 4px; }
.btn-icon-small:hover { background: rgba(0,0,0,0.05); color: var(--point-color, #97c3d1); }
.btn-icon-small svg { width: 14px; height: 14px; fill: currentColor; }
.btn-icon-small.del:hover { color: #ff6b6b; } 

.secret-blur { color: transparent; text-shadow: 0 0 10px rgba(0,0,0,0.5); background: rgba(240,240,240,0.5); border-radius: 5px; user-select: none; cursor: pointer; }
.empty_list { text-align: center; margin-top: 50px; color: #888; font-size: 12px; }

.design-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.design-modal { background: #fff; padding: 20px; border-radius: 15px; width: 300px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); max-height: 80vh; overflow-y: auto; }
.design-modal h3 { margin: 0 0 15px 0; font-size: 16px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.opt-row { margin-bottom: 10px; display: flex; flex-direction:column; gap:5px; }
.opt-row label { font-size: 12px; color: #555; font-weight:bold;}
.opt-row input[type="color"] { border: none; width: 100%; height: 35px; cursor: pointer; padding: 0; }
.opt-row select, .opt-row .input-text { 
    border: 1px solid #ddd; 
    padding: 0 8px; /* 상하 패딩 제거 후 높이로 제어 */
    height: 35px; /* 색상 인풋과 높이 맞춤 */
    line-height: 35px; /* 텍스트 수직 정렬 */
    font-size: 12px; 
    border-radius: 5px; 
    width: 100%; 
    box-sizing: border-box;
    vertical-align: middle;
}
.btn-row { margin-top: 20px; text-align: right; }
.btn-save { background: #333; color: #fff; border: none; padding: 5px 15px; border-radius: 5px; cursor: pointer; }
.btn-close { background: #eee; color: #555; border: none; padding: 5px 10px; border-radius: 5px; cursor: pointer; margin-left: 5px; }

/* 관리자 삭제 버튼 */
.btn-quick-del {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 18px; height: 18px;
    background: #fff; border: 1px solid #eee;
    color: #ff6b6b; border-radius: 50%;
    margin-left: 5px; cursor: pointer;
    vertical-align: middle;
}
.btn-quick-del:hover { background: #ff6b6b; color: #fff; border-color: #ff6b6b; }
.btn-quick-del svg { width: 10px; height: 10px; fill: currentColor; }

/* 비밀글 아이콘 */
.secret-indicator { font-size: 11px; color: #ff6b6b; margin-right: 3px; vertical-align: middle; }

/* 비밀글 비밀번호 입력폼 */
.secret-inline-form {
    display: none; /* 평소엔 숨김 */
    align-items: center;
    gap: 5px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #eee;
}
.secret-input {
    border: 1px solid #ddd;
    padding: 5px;
    font-size: 12px;
    border-radius: 4px;
    width: 100px;
    outline: none;
}
.btn-secret-ok {
    background: #555;
    color: #fff;
    border: none;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
}

/* 로딩 광택 효과 */
@keyframes shineSwipe {
    0% { left: -150%; opacity: 0; }
    5% { opacity: 1; }
    100% { left: 150%; opacity: 0; }
}

.chat-frame-body::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 80%;
    height: 100%;
    
    
    background: linear-gradient(
        to right, 
        transparent 0%, 
        transparent 40%,
        rgba(255,255,255, 0.4) 40%, 
        rgba(255,255,255, 0.8) 50%, 
        rgba(255,255,255, 0.4) 60%,
        transparent 60%, 
        transparent 100%
    );
    
    
    transform: skewX(-25deg);
    
    pointer-events: none; 
    z-index: 100;
    
    
    animation: shineSwipe 2.0s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

/* 공지 체크박스 */
.notice-check-box { position: relative; width: 30px; height: 30px; }
.notice-check-box input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; z-index: 2; }
.notice-check-icon { 
    width: 100%; height: 100%; 
    border: 1px solid #eee; 
    background: #fff; 
    border-radius: 8px; 
    display: flex; align-items: center; justify-content: center; 
    color: #ddd; 
    transition: 0.2s; 
    font-size: 14px;
}

.notice-check-box input:checked + .notice-check-icon { 
    background: #555; 
    border-color: #333; 
    color: #fff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}